<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>write()和writeln()的不同</title>
</head>

<body>
    <p>注意write()方法不会在每个语句后面新增一行：</p>
    <pre>
<script>
    document.write("Hello World!");
    document.write("Have a nice day!");
</script>
</pre>
    <p>注意writeln()方法在每个语句后面新增一行：</p>
    <pre>
<script>
    document.writeln("Hello World!");
    document.writeln("Have a nice day!");
</script>
</pre>
</body>

</html>